home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / gpt32src.zip / V384.TRM < prev    next >
Text File  |  1992-03-25  |  3KB  |  130 lines

  1. /*
  2.  * $Id: v384.trm,v 3.26 92/03/24 22:35:48 woo Exp Locker: woo $
  3.  */
  4.  
  5. /* GNUPLOT - v384.trm */
  6. /*
  7.  * Copyright (C) 1990, 1991, 1992   
  8.  *
  9.  * Permission to use, copy, and distribute this software and its
  10.  * documentation for any purpose with or without fee is hereby granted, 
  11.  * provided that the above copyright notice appear in all copies and 
  12.  * that both that copyright notice and this permission notice appear 
  13.  * in supporting documentation.
  14.  *
  15.  * Permission to modify the software is granted, but not the right to
  16.  * distribute the modified code.  Modifications are to be distributed 
  17.  * as patches to released version.
  18.  *  
  19.  * This software  is provided "as is" without express or implied warranty.
  20.  * 
  21.  * This file is included by ../term.c.
  22.  *
  23.  * This terminal driver supports:
  24.  *  Vectrix 384 - works with tandy color printer as well
  25.  *
  26.  * AUTHORS
  27.  *   roland@moncskermit.OZ (Roland Yap) 
  28.  * 
  29.  * send your comments or suggestions to (info-gnuplot@ames.arc.nasa.gov).
  30.  * 
  31.  */
  32.  
  33. /*
  34.  *    Vectrix 384 driver - works with tandy color printer as well
  35.  *  in reverse printing 8 color mode.
  36.  *  This doesn't work on Vectrix 128 because it redefines the
  37.  *  color table. It can be hacked to work on the 128 by changing
  38.  *  the colours but then it will probably not print best. The color
  39.  *  table is purposely designed so that it will print well
  40.  *
  41.  */
  42.  
  43. #define V384_XMAX 630
  44. #define V384_YMAX 480
  45.  
  46. #define V384_XLAST (V384_XMAX - 1)
  47. #define V384_YLAST (V384_YMAX - 1)
  48.  
  49. #define V384_VCHAR    12
  50. #define V384_HCHAR    7
  51. #define V384_VTIC    8
  52. #define V384_HTIC    7
  53.  
  54.  
  55. V384_init()
  56. {
  57.     fprintf(outfile,"%c%c  G0   \n",27,18);
  58.     fprintf(outfile,"Q 0 8\n");
  59.     fprintf(outfile,"0 0 0\n");
  60.     fprintf(outfile,"255 0 0\n");
  61.     fprintf(outfile,"0 255 0\n");
  62.     fprintf(outfile,"0 0 255\n");
  63.     fprintf(outfile,"0 255 255\n");
  64.     fprintf(outfile,"255 0 255\n");
  65.     fprintf(outfile,"255 255 0\n");
  66.     fprintf(outfile,"255 255 255\n");
  67. }
  68.  
  69.  
  70. V384_graphics()
  71. {
  72.     fprintf(outfile,"%c%c E0 RE N 65535\n",27,18);
  73. }
  74.  
  75.  
  76. V384_text()
  77. {
  78.     fprintf(outfile,"%c%c\n",27,17);
  79. }
  80.  
  81.  
  82. V384_linetype(linetype)
  83. int linetype;
  84. {
  85. static int color[]= {
  86.         1 /* red */,
  87.         2 /* green */,
  88.         3 /* blue */,
  89.         4 /* cyan */,
  90.         5 /* magenta */,
  91.         6 /* yellow */, /* not a good color so not in use at the moment */
  92.         7 /* white */
  93.     };
  94.         
  95.     if (linetype < 0)
  96.         linetype=6;
  97.     else
  98.         linetype %= 5;
  99.     fprintf(outfile,"C %d\n",color[linetype]);
  100. }
  101.  
  102.  
  103. V384_move(x,y)
  104. unsigned int x,y;
  105. {
  106.     fprintf(outfile,"M %d %d\n",x+20,y);
  107. }
  108.  
  109.  
  110. V384_vector(x,y)
  111. unsigned int x,y;
  112. {
  113.     fprintf(outfile,"L %d %d\n",x+20,y);
  114. }
  115.  
  116.  
  117. V384_put_text (x, y, str)
  118. unsigned int x, y;
  119. char str[];
  120. {
  121.     V384_move (x, y + V384_VCHAR/2);
  122.     fprintf (outfile, "$%s\n", str);
  123. }
  124.  
  125.  
  126. V384_reset()
  127. {
  128. }
  129.  
  130.